﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace TMHuy.config
{
    [System.Xml.Serialization.XmlInclude(typeof(Village))]
    public class AllConfig
    {
        public String account;
        public String password;
        public String account2;
        public String password2;
        public String server;
        public ArrayList villages;
        public ArrayList farmlists;
        public ArrayList taskChecks;
        public string heroVillageId;
        public bool heroSolo;
        public int heroSoloMinHealth;
        public int heroAttackX;
        public bool heroAdventure;
        public bool heroClearWithTroop;
        public int heroClearMinHealth;
        public int heroTroopAttackX;
        public Troop heroTroopType;
        public bool heroUseInfantryDef;
        public bool autoAddFighting = false;
        public ArrayList routes;
        public int raidInterval = 2400;
        public int merchanCapacity = 500;
        public bool fullMerchan = false;
        public string screen = "1366:768";
        public bool useTor = false;

        public AllConfig()
        {
            villages = new ArrayList();
            farmlists = new ArrayList();
            taskChecks = new ArrayList();
            routes = new ArrayList();
        }

        public Village getVillageByName(string name)
        {
            foreach (Village village in villages)
            {
                if (village.name.Equals(name))
                {
                    return village;
                }
            }
            return null;
        }
    }
}
